package com.example.javastream.demo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Stream;

public class CreateStream {
    public static void main(String[] args) {
        // 集合转流
        Collection<String> stringList = new ArrayList<>();
        Stream<String> stringStream = stringList.stream();
        // 数组转流
        Integer[] integers = {1, 2};
        Stream<Integer> integerStream = Arrays.stream(integers);
        // 迭代器、生成器...
    }
}
